package cn.cyb.server.service;

import cn.cyb.server.domain.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.Set;

/**
 * @author yuebo
 * @date 2025/3/4
 */
@Service
public class SysPermissionService {

    @Autowired
    private ISysRoleService roleService;

    public Set<String> getRolePermission(SysUser sysUser) {
        Set<String> roles = new HashSet<>();
        Set<String> permissionSet = roleService.selectRolePermissionByUserId(sysUser.getUserId());
        roles.addAll(permissionSet);
        return roles;
    }
}
